﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using ESOL.Common.Entity;
using System.Data;

namespace ESOL.Services
{
    [ServiceContract]
    public interface ISalesService
    {
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool TestConnect();

        //SalesOrder 订单
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesSoEntity GetSalesSoByKey(string salesOrderId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesSoItemEntity GetSalesSoItemByKey(string soItemId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesSoItemEntity> GetSalesSoItemAllListBySoNo(string soItemId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesSoPageResult GetSalesSoAllListByCondition(SalesSoQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateSalesSo(SalesSoEntity so);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveSalesSo(SalesSoSaveParam param);

        //SalesItem订单明细
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesSoItemPageResult GetSalesSoItemAllListByCondition(SalesSoQueryCondition con);

        //SalesAppItem
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesAppItemEntity GetSalesAppItemByKey(string id);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetSalesAppItemAllDsByAppId(string salesAppId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesAppItemEntity> GetSalesAppItemAllListByAppId(string salesAppId);

        //SalesApp 申请单
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesAppEntity GetSalesAppByKey(string salesAppId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesAppEntity GetSalesAppByAppNo(string salesAppNo);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesAppPageResult GetSalesAppAllListByCondition(SalesAppQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateSalesApp(SalesAppEntity salesApp);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelSalesApp(SalesAppEntity salesApp);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveSalesApp(SalesAppSaveParam param);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesSoItemEntity> GetListSoItemBySoNo(string salesOrderId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<BptAppEntity> SalesAppToBptApp(SalesAppEntity salesApp, DataSet salesAppItems);

        //SalesProdAppItem 生产计划申请单明细
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesProdAppItemPageResult GetSalesProdAppItemAllListByCondition(SalesAppQueryCondition con);

        //SalesQu 销售报价单
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesQuEntity GetSalesQuByKey(string quId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveSalesQu(SalesQuSaveParam param);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesQuPageResult GetSalesQuAllListByCondition(SalesQuQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool InsertSalesQu(string userNo, SalesQuEntity qu);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateSalesQu(string userNo, SalesQuEntity qu);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelSalesQu(SalesQuEntity qu);

        //SalesQuItem 销售报价单明细
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesQuItemEntity> GetSalesQuItemAllListByQuId(string quId);

        //SalesShip 销售发货单
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesShipEntity GetSalesShipByKey(string shipId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveSalesShip(SalesShipSaveParam param);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesShipPageResult GetSalesShipAllListByCondition(SalesShipQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool InsertSalesShip(string userNo, SalesShipEntity ship);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateSalesShip(string userNo, SalesShipEntity ship);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelSalesShip(SalesShipEntity ship);

        //SalesRo 销售发货单明细
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesShipItemEntity> GetSalesShipItemAllListByShipId(string shipId);

        //SalesRo 销售退货单
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesRoEntity GetSalesRoByKey(string roId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveSalesRo(SalesRoSaveParam param);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesRoPageResult GetSalesRoAllListByCondition(SalesRoQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool InsertSalesRo(string userNo, SalesRoEntity ro);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateSalesRo(string userNo, SalesRoEntity ro);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelSalesRo(SalesRoEntity ro);

        //SalesRoItem 销售退货单明细
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesRoItemDto> GetSalesRoItemDtoAllListByRoId(string roId);



        //销售汇总表
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesCustomerSummeryPageResult GetSalesCustomerSummary(SalesCustomerSummaryQueryCondition con);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesAppEntity> GetSalesAppAllListByAppIdList(List<string> appIdList);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesProdAppFinishDialogDto> GetSalesProdAppFinishDialogDto(SalesAppEntity app);


        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesProdAppFinishResult> SalesProdAppFinish(string userNo, List<SalesProdAppFinishDialogDto> source);
        
        //销售业务清单
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesCutomerBusinessListPageResult GetSalesCustomerBusinessList(SalesCutomerBusinessListQueryCondition con);

        //查询已绑定的合同单号
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<SalesAppBindSoDto> GetSalesBindByAppItemId(string appItemId);

        //绑定合同单号
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        SalesCutomerBusinessListDto BindingSoForCustomerBusiness(SalesCutomerBusinessListDto d, List<SalesAppBindSoDto> s);
    }
}
